package com.raindrop.utils;

/**
 * Created by liuhang on 2017/4/20.
 * 随机数工具
 */

public class RandomUtil {

    public static int randomNumber(int length) {
        int size = (int) Math.pow(10, length);
        int result = (int) (Math.random() * size);
        if (result < size / 10)
            return randomNumber(length);
        return result;
    }

    public static void main(String[] args) {
//        System.out.println(randomNumber(6));
    }
}
